home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / updateWorldViewEditors.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.6 KB  |  90 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. global proc updateWorldViewEditors( ) 
  18. //
  19. // Alias|Wavefront Script File
  20. // MODIFY THIS AT YOUR OWN RISK
  21. //
  22. // Creation Date:  3 December 1996
  23. // Author:         jb
  24. //
  25. //
  26. //  Procedure Name:
  27. //      updateWorldViewEditors
  28. //
  29. //  Description:
  30. //        Sets up display states for layers, based on 
  31. //        checkbox settings of LayerMenu menuItems.  Called
  32. //        when the user switches which layer they're "looking"
  33. //        at.
  34. //
  35. //  Input Arguments:
  36. //      None.
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41. //
  42. {
  43.     string $activeLayerName = `optionMenu -q -v layerPopup`;
  44.     int $visibleState = 0;
  45.     int $templateState = 0;
  46.     if ( `menuItem -exists hideNonCurrentLayersItem` )
  47.         $visibleState = `menuItem -q -cb hideNonCurrentLayersItem`;
  48.     if ( `menuItem -exists templateNonCurrentLayersItem` )
  49.         $templateState = `menuItem -q -cb templateNonCurrentLayersItem`;
  50.         
  51.     
  52.     string $layers[] = `listAllLayers`;
  53.  
  54.     if( $visibleState != 0 || $templateState != 0 )
  55.     //
  56.     // Either the visible state or template state
  57.     // of non-current layers is set to true, so
  58.     // some processing of the display of layers
  59.     // must be done.
  60.     {
  61.         if( $activeLayerName == "Universe" ) {
  62.         //
  63.         // The user is looking at the "Universe"
  64.         // layer, so untemplate and unhide all
  65.         // layers in the system.
  66.         //
  67.             for( $item in $layers ) {
  68.                 showHidden -a $item;
  69.                 toggle -template -state off $item;
  70.             }
  71.         } else {
  72.             for( $item in $layers ) {
  73.                 if( $item == $activeLayerName ) {
  74.                     if( $visibleState == 1 ) {
  75.                         showHidden -a $item;
  76.                     } else {
  77.                         toggle -template -state off $item;
  78.                     }
  79.                 } else {
  80.                     if( $visibleState == 1 ) {    
  81.                         hide $item;
  82.                     } else {
  83.                         toggle -template -state on $item;
  84.                     }
  85.                 }
  86.             }
  87.         }
  88.     }
  89. }
  90.